package com.example.second.state.classes;

import com.example.second.state.interfaces.ILEDState;

/**
 * @ClassName: RoomLed$
 * @Description: 具体的灯，主要包含当前状态、LedOnState、LedOffState
 * @Author: xinya
 * @CreateDate: 2020/12/21$ 14:07$
 * @UpdateRemark: 更新内容
 * @Version: 1.0
 */
public class RoomLed {
    private ILEDState mState;
    private ILEDState mLEDOnState;
    private ILEDState mLedOffState;


    public RoomLed() {
        mLEDOnState = new LedOnState(this);
        mLedOffState = new LedOffState(this);
        mState = mLedOffState;
    }

    public void setState(ILEDState state) {
        mState = state;
    }

    public ILEDState getState() {
        return mState;
    }

    public ILEDState getLEDOnState() {
        return mLEDOnState;
    }

    public ILEDState getLedOffState() {
        return mLedOffState;
    }

    public void setLedOn() {
        mState.ledOn();
    }

    public void setLedOff() {
        mState.ledOff();
    }
}
